package com.rinlink.jbcodec.transform;

import com.rinlink.jbcodec.exception.TransformException;

import java.nio.ByteBuffer;
import java.util.List;

public abstract class BytesToNumberList<T extends Number> extends BytesToList<T>{

    private String order;

    public BytesToNumberList(ByteBuffer byteBuffer, int listSize,String order) {
        super(byteBuffer, listSize);
        this.order = order;
    }

    @Override
    public List<T> transform() throws TransformException {
        getByteBuffer().order(NumberToBytes.order(order));
        return super.transform();
    }
}
